//
//  WaiSongNavTitleView.m
//  FD
//
//  Created by Yasin on 2018/10/22.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//  外送自定义导航栏的中间的标题view


#import "WaiSongNavTitleView.h"
@interface WaiSongNavTitleView()
/**1.地址按钮*/
@property (nonatomic,  strong) UIButton *addressBtn;
/**2.送达时间lb 富文本*/
@property (nonatomic,  strong) UILabel *songDaTimeLb;
@end

@implementation WaiSongNavTitleView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView {
    //设置frame
    CGFloat s_w = self.bounds.size.width;
    CGFloat s_h = self.bounds.size.height;
    
    self.addressBtn.frame = CGRectMake(0, 0, s_w, s_h*0.5);
    self.songDaTimeLb.frame = CGRectMake(0, self.addressBtn.rb_bottom, s_w, s_h * 0.5);
    [self addSubview:self.addressBtn];
    [self addSubview:self.songDaTimeLb];
}

///getter
- (UIButton *)addressBtn {
    if (!_addressBtn) {
        _addressBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_addressBtn setTitle:@"杭州佰富时代1幢908" forState:(UIControlStateNormal)];
        [_addressBtn setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        [_addressBtn addTarget:self action:@selector(clickAddressBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _addressBtn;
}

- (UILabel *)songDaTimeLb {
    if (!_songDaTimeLb) {
        _songDaTimeLb = [[UILabel alloc] init];
        _songDaTimeLb.text = @"外送|约40分钟送达";
    }
    return _songDaTimeLb;
}


#pragma mark - 点击事件
- (void)clickAddressBtnAction:(UIButton *)btn
{
    FDLog(@"点击了按钮");
}

@end
